package com.wing.product.model.response;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.wing.product.model.entity.ProductSpecValue;
import lombok.Data;
import lombok.NoArgsConstructor;
import lombok.experimental.Accessors;

import java.time.LocalDateTime;

/**
 * 产品类型规格值VO
 *
 * @author
 */
@Data
@NoArgsConstructor
@Accessors(chain = true)
public class ProductSpecValueVO {

    /**
     * ID
     */
    private Long id;

    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8" , pattern = "yyyy-MM-dd HH:mm:ss" )
    private LocalDateTime createTime;

    /**
     * 创建者
     */
    private Long creator;

    /**
     * 修改者
     */
    private Long modifier;

    /**
     * 创建人
     */
    private String creatorName;

    /**
     * 修改人
     */
    private String modifierName;

    /**
     * 产品类型ID
     */
    private Long productType;

    /**
     * 产品类型规格ID
     */
    private Long productSpecId;

    /**
     * 值
     */
    private String value;

    @TableField(exist = false)
    private String specHead;
    @TableField(exist = false)
    private String specCode;
    @TableField(exist = false)
    private String specLocation;
    @TableField(exist = false)
    private String specSort;

    private ProductSpecValue.DataSourceType dataSourceType;

    private Long idPlatform;

    @TableField(exist = false)
    private String dataSourceTypeDesc;

    public String getDataSourceTypeDesc(){
        if (dataSourceType!=null){
            return dataSourceType.getDesc();
        }
        return "";
    }

    /**
     * 排序
     */
    private Integer sortNumber;

}
